package com.fub.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class TransparentPanel extends LinearLayout {

	private Paint innerPaint;

	public TransparentPanel(Context context, AttributeSet attrs) {
		super(context, attrs);
		initPaints();
	}

	private void initPaints() {
		this.innerPaint = new Paint();
		this.innerPaint.setStyle(Style.FILL);
		this.innerPaint.setARGB(225, 75, 75, 75);
	}

	@Override
	protected void dispatchDraw(Canvas canvas) {
		RectF drawRect = new RectF();
		drawRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
		canvas.drawRoundRect(drawRect, 5, 5, this.innerPaint);
		super.dispatchDraw(canvas);
	}
}
